<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="/static/js3/jQuery-2.1.4/jquery-2.1.4.min.js"></script>
    <script>
        var content='';
        window.onload=function () {
            document.querySelector('#btn').onclick=function () {
                var divEle=document.querySelector('#content');
                if(divEle.innerHTML){
                    content=divEle.innerHTML;
                    divEle.innerHTML='';
                }else {
                    divEle.innerHTML=content;
                }
            }
        }
       /* $(function () {
            $('#btn').click(function () {
                $('#content').toggle(1000);
            });
        });*/
    </script>
</head>
<body>
<div id="content">
    信息: Starting Servlet Engine: Apache Tomcat/7.0.37
    十月 30, 2019 7:46:42 下午 org.apache.catalina.core.ApplicationContext log
    信息: No Spring WebApplicationInitializer types detected on classpath
    十月 30, 2019 7:46:42 下午 org.apache.catalina.core.ApplicationContext log
    信息: Initializing Spring FrameworkServlet 'dispatcherServlet'
    十月 30, 2019 7:46:43 下午 org.apache.coyote.AbstractProtocol start
    信息: Starting ProtocolHandler ["http-bio-8080"]
</div>
<button id="btn">切换显示</button>
</body>
</html>